/*
 * COPYRIGHT:	2010 Christopher Smith, licenced under the GNU GPL v2; see COPYING in the top level directory
 * PROJECT:		sdedit
 * FILE:		C version (POD only) of sdedit structures
 * PURPOSE:		
 *				
 */

#pragma once

struct SECURITY_ENVIRONMENT
{
	SID const *Owner;
	SID const *Group;
	SID const *Admins;
	SID const *NullSid;
};

struct ACL_AND_STATE
{
	ACL *Acl;
	ULONG State;
};

struct SID_AND_STATE
{
	SID *Sid;
	ULONG State;
};

struct RMBITS_AND_STATE
{
	UCHAR Bits;
	UCHAR Pad0;
	USHORT State;
};

struct SD_EDIT_STATE
{
	ULONG Version;
	ULONG State;
	ACL_AND_STATE Dacl;
	ACL_AND_STATE Sacl;
	ACL_AND_STATE Lacl;
	SID_AND_STATE Owner;
	SID_AND_STATE Group;
	RMBITS_AND_STATE RMBits;
};

//dialog callback to re-arrange Acl with inherited ACEs replaced with actual inherited ACEs
//arragned according to merge mode
//used for ACL editor dialog from DN_QUERY_INHERITANCE callback
struct DN_QUERY_INHERITANCE_ACL
{
	ACL_AND_STATE *Acl;
};

//dialog callback to retrieve a default Acl
//used for ACL editor dialog from DN_QUERY_DEFAULT callback
struct DN_QUERY_DEFAULT_ACL
{
	ACL_AND_STATE *Acl;
};

//replace the Dacl and/or Sacl (if present) with auto-inherited versions (same as DN_QUERY_INHERITANCE_ACL)
//used for SD editor dialog from DN_QUERY_INHERITANCE callback
struct DN_QUERY_INHERITANCE_ES
{
	SD_EDIT_STATE Es;
};

//dialog callback to retrieve a default edit state
//used for SD editor dialog from DN_QUERY_DEFAULT callback
struct DN_QUERY_DEFAULT_ES
{
	SD_EDIT_STATE Es;
};
